733
class Solution {
    int row = 0;
    int col = 0;
    int a = 0;
    public int[][] floodFill(int[][] image, int sr, int sc, int color) {
        row = image.length;
        col = image[0].length;

        a = image[sr][sc];
        if (a == color) {
            return image;
        }
        image[sr][sc] = color;
        fun(image, color, sr, sc);
        return image;
    }

    public void fun(int[][] image, int color, int x, int y) {
        x++;
        if (x  row && image[x][y] == a) {
            image[x][y] = color;
            fun(image, color, x, y);
        }
        x -= 2;
        if (x = 0 && image[x][y] == a) {
            image[x][y] = color;
            fun(image, color, x, y);
        }
        x++;
        y--;
        if (y = 0 && image[x][y] == a) {
            image[x][y] = color;
            fun(image, color, x, y);
        }
        y += 2;
        if (y  col && image[x][y] == a) {
            image[x][y] = color;
            fun(image, color, x, y);
        }
    }
}
import java.util.*;


public class Solution {

    public int jumpFloorII (int number) {
        // write code here
       
        int[] arr = new int[number + 1];
        arr[0] = 1;
        for (int i = 1; i <= number; i++){
            int tmp = 0;
            for (int j = 0; j < i; j++){
                tmp += arr[j];
            }
            arr[i] = tmp;
        }
        return arr[number];
    }
}